#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int get_number() {
    string line;
    int num;
    while (true) {
        cout << " Enter a number (1-3): ";
        getline(cin, line);
        stringstream ss(line);
// 读取str并复制到ss
        if (ss >> num) {
            if (num==1){
                    cout <<"One is the first number"<<endl;
                }
            if (num==2)
                {
                    cout <<"Two is the second number"<<endl;
                } 

            if (num==3)
                {
                    cout <<"Three is the third number"<<endl;
                } 
            else {
                cout << "Invalid numbe" << endl;
            } 
        }
    }
}

int main() {
    int valid_number = get_number();
    cout << "You entered: " << valid_number << endl;
    return 0;
}